package com.ruoyi.webs.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class ResourceUtils {
    private static Logger log = LoggerFactory.getLogger(ResourceUtils.class);
    public static final String BATCH_PAY_CLASS_PATH = "/exportTemplate/transferAccount.xls";
    public static volatile Resource salaryExportResource = null;


    public static Resource getTemplateResource() {
        if (salaryExportResource == null) {
            synchronized (ResourceUtils.class) {
                if (salaryExportResource == null) {
                    salaryExportResource = (Resource) new ClassPathResource("/exportTemplate/transferAccount.xls");
                    return salaryExportResource;
                }
                return salaryExportResource;
            }
        }

        return salaryExportResource;
    }
}